home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / utility1 / gs261src.zip / GXCDIR.H < prev    next >
C/C++ Source or Header  |  1993-05-19  |  3KB  |  67 lines

  1. /* Copyright (C) 1993 Aladdin Enterprises.  All rights reserved.
  2.  
  3. This file is part of Ghostscript.
  4.  
  5. Ghostscript is distributed in the hope that it will be useful, but
  6. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  7. to anyone for the consequences of using it or for whether it serves any
  8. particular purpose or works at all, unless he says so in writing.  Refer
  9. to the Ghostscript General Public License for full details.
  10.  
  11. Everyone is granted permission to copy, modify and redistribute
  12. Ghostscript, but only under the conditions described in the Ghostscript
  13. General Public License.  A copy of this license is supposed to have been
  14. given to you along with Ghostscript so you can know your rights and
  15. responsibilities.  It should be in a file named COPYING.  Among other
  16. things, the copyright notice and this notice must be preserved on all
  17. copies.  */
  18.  
  19. /* gxcdir.h */
  20. /* Definitions for character cache management */
  21.  
  22. /* Font/matrix pair cache management */
  23.  
  24. #ifndef cached_fm_pair_DEFINED
  25. #  define cached_fm_pair_DEFINED
  26. typedef struct cached_fm_pair_s cached_fm_pair;
  27. #endif
  28. typedef struct fm_pair_cache_s {
  29.     uint msize, mmax;        /* # of cached font/matrix pairs */
  30.     cached_fm_pair *mdata;
  31.     uint mnext;            /* rover for allocating font/matrix pairs */
  32. } fm_pair_cache;
  33.  
  34. /*
  35.  * We allocate the character cache in chunks, so as not to tie up memory
  36.  * prematurely if it isn't needed (or something else needs it more).
  37.  * Thus there is a structure for managing an entire cache, and another
  38.  * structure for managing each chunk.
  39.  */
  40.  
  41. typedef struct char_cache_chunk_s char_cache_chunk;
  42. struct char_cache_chunk_s {
  43.     char_cache_chunk *next;
  44.     byte *data;        /* struct cached_char_head_s * */
  45.     uint size;
  46. };
  47.  
  48. #ifndef cached_char_DEFINED
  49. #  define cached_char_DEFINED
  50. typedef struct cached_char_s cached_char;
  51. #endif
  52. typedef struct char_cache_s {
  53.     const gs_memory_procs *mprocs;
  54.     uint bsize, bmax;        /* # of bytes for cached chars */
  55.     uint bspace;            /* space allocated for chunks */
  56.     uint csize, cmax;        /* # of cached chars */
  57.     uint lower;            /* min size at which cached chars */
  58.                     /* should be stored compressed */
  59.     uint upper;            /* max size of a single cached char */
  60.     cached_char **chars;        /* chain heads */
  61.     uint chars_mask;        /* (a power of 2 -1) */
  62.     char_cache_chunk *chunks;    /* current chunk in circular list */
  63.     uint cnext;            /* rover for allocating characters */
  64.                     /* in current chunk */
  65.     char_cache_chunk initial_chunk;    /* dummy initial chunk */
  66. } char_cache;
  67.